package com.gitee.ywj1352.delegate.leader;

import java.util.HashMap;
import java.util.Map;

/**
 * 委派类 wenjie.yang on 3/27/2019.
 */
public class Leader implements IStaff{
  // 保存 做活的人
  private Map<String,IStaff> staffMapping = new HashMap<String, IStaff>();

  public Leader(){
    staffMapping.put("加密",new StaffA());
    staffMapping.put("登录",new StaffB());
  }

  public void doing(String command){
    staffMapping.get(command).doing(command);
  }

}
